package com.carambatv.android.ui.sliding;

import android.content.Context;
import android.util.Log;

import com.the111min.android.api.BaseApiHelper;
import com.the111min.android.api.Request;
import com.the111min.android.api.Request.Builder;
import com.the111min.android.api.Request.RequestMethod;
import com.the111min.android.api.ResponseReceiver;

public class MyApiHelper extends BaseApiHelper {
	public String BASE_URL = "http://gdata.youtube.com/feeds/api/users/";
	public static final int COUNT = 10;
	public static final String ITEM_NUMBER = "item_number";

	public MyApiHelper(Context context, ResponseReceiver receiver) {
		super(context, receiver);
	}

	public void getVideo(String type, int first) {
		StringBuilder sb = new StringBuilder();
		Log.w("url", sb.toString());
		sb.append(BASE_URL).append(type).append("/uploads").append("?start-index=").append(String.valueOf(first)).append("&max-results=").append(String.valueOf(COUNT));
		Request.Builder builder = new Builder(sb.toString(), RequestMethod.GET).setResponseHandler(VideoResponceHandler.class);
		builder.addTemporaryData(VideoFragment.TYPE, type);
		builder.addTemporaryData(ITEM_NUMBER, first);
		sendRequest(builder.create());
	}

}